<!--
/**
* Author: gqz
* Date: 2021-07-30 16:55
* Desc: ZmButton
*/
-->
<template>
  <view :class="customClass" class="zm-button bc-primary">
    <u-button
      :type="type"
      :size="size"
      :disabled="disabled"
      :plain="plain"
      :open-type="openType"
      :scope="scope"
      @click="handleClick"
      @getphonenumber="getphonenumber"
      @getuserinfo="getuserinfo"
      @error="error"
      :hover-class="hoverClass"
      :shape="shape"
      :custom-style="customStyle"
      :throttle-time="200"
      :color="color"
    >
      <slot />
    </u-button>
  </view>
</template>

<script>
  import styleMixins from '@/mixins/styleMixins'
  export default {
    name: 'yy-button',
    mixins: [styleMixins],
    props: {
      color: {
        type: String
      },
      type: {
        type: String,
        default: 'primary'
      },
      disabled: {
        type: Boolean
      },
      type: {
        type: String,
        default: 'primary'
      },
      disabled: {
        type: Boolean
      },
      plain: {
        type: Boolean,
        default: false
      },
      hoverClass: {
        type: String,
        default: 'none'
      },
      openType: {
        type: String,
        default: ''
      },
      scope: {
        type: String,
        default: ''
      },
      shape: {
        type: String,
        default: ''
      },

      size: {
        type: String,
        default: 'medium'
      }
    },

    data() {
      return {}
    },
    methods: {
      handleClick(e) {
        this.$emit('click', e)
      },
      getphonenumber(e) {
        this.$emit('getphonenumber', e)
      },
      getuserinfo(e) {
        this.$emit('getuserinfo', e)
      },
      error(e) {
        this.$emit('error', e)
      }
    }
  }
</script>

<style lang="scss">
  .zm-button.bc-primary {
    border-radius: 20rpx;
  }
</style>
